# MySQL 数据库备份 shell 脚本
db_user=""
db_password=""
db_name=""
db_table=""
backup_dir="./"
#time="$(date '+%Y-%m-%d')"
time="$(date '+%u')"

#mysqldump --user=$db_user --password=$db_password $db_name > $backup_dir/$db_name"_"$time.sql
mysqldump --user=$db_user --password=$db_password $db_name | gzip > $backup_dir/$db_name"_"$time.sql.gz